def print_diamond(rows):
    for i in range(rows):
        print(" " * (rows - 1 - i),end='')
        print("* " * (i + 1))

    for j in range(rows - 1):
        print(" " * (j + 1),end="")
        print("* " * (rows - 1 - j))

print_diamond(5)


# 行   *        空格
# 0   1         4       4  4-0=4    1 0+1=1
# 1   2         3       3  4-1=3    2 1+1=2
# 2   3 2+1=3   2       2  4-2=2    3 2+1=3
# 3   4 3+1=4   1       1  4-3=1    4 3+1=4
# 4   5 4+1=5   0